<html>
<head>
    <title>个人备忘系统</title>
    <style>
        * {margin: 0; padding: 0; font-size: 14px;}
        a{text-decoration: none}
        .box {width: 1000px; margin: 0 auto}
        .header{height:100px; background-color:#555;
            display: flex; justify-content: space-between; color: #fff}
        .logo {
            padding: 20px 20px;
            font-size: 30px; font-weight: bold;
        }
        .top-op {
            padding: 10px 20px;
        }
        .top-op a{
            color: #ffffff;
        }
        .top-op a:hover{
            text-decoration: underline;
        }
        .lists{
            margin-top: 10px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
        }
        table tr th {
            background-color: #ccc;
        }
        table tr td, table tr th{
            border: 1px solid #ddd;
            padding: 3px;
        }
    </style>
</head>
<body>
<div class="box">
    <?php include_once './Views/common/header.php';?>
    <div class="lists">
        <form action="" id="form-add">
            <div>
                <input type="text" name="content" id="content" placeholder="请输入内容">
            </div>
            <div>
                <input type="text" name="complete_date" id="complete_date" placeholder="请输入日期">
            </div>
            <div>
                <input type="submit" value="立即发布">
            </div>
        </form>
    </div>
</div>
</body>
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script>
    jQuery(function (){
        jQuery('#form-add').submit(function() {
            var params = {
                content: jQuery('#content').val(),
                complete_date: jQuery('#complete_date').val()
            }
            jQuery.post('/index.php?c=center&a=doAdd', params, function (data){
                if (data.code == 1) {
                    window.location.href='/index.php?c=center&a=index'
                } else {
                    alert(data.msg)
                }
            }, 'json')
            return false
        })
    })
</script>
</html>